﻿#region Imports
using System.Collections.Generic;
using DirectoryAnalyzer.Properties;
#endregion

namespace DirectoryAnalyzer.Models
{
    public class FileTypes
    {
        #region Properties
        private static Dictionary<string, IEnumerable<string>> allFileTypes;
        public static Dictionary<string, IEnumerable<string>> AllFileTypes { get { return GetFileTypes(); } }
        #endregion

        public static Dictionary<string, IEnumerable<string>> GetFileTypes()
        {
            allFileTypes = new Dictionary<string, IEnumerable<string>>();

            var sett = new Settings();
            foreach (var item in sett.GetType().GetProperties())
                if (item.Name.Contains("_files"))
                    allFileTypes.Add(item.Name.Replace("_", " "), item.GetValue(sett, null).ToString().ToUpper().Split(','));

            return allFileTypes;
        }
    }
}
